<%-- 
    Document   : main
    Created on : Feb 14, 2012, 9:33:28 AM
    Author     : administrator2
--%>

<%-- Header Area --%>
<%@ include file="/template/header.jsp" %> 
<%-- End of Header Area --%>


<%-- Content Area --%>
<h2>${title}</h2>
<div class="submenu">
    <ul>
        <li><a href="/manage">Manage</a></li>
        <li><a href="/manage/category/add">+ New Category</a></li>
    </ul>
    <div class="clear"></div>
</div>

<table class="generic-vertical-table">
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Active</th>
        <th>Actions</th>
    </tr>
    <% if (categories != null) {%>

    <% for (Category c : categories) {%>
    <tr>
        <td><%= c.getId()%></td>
        <td><%= c.getName()%></td>
        <td><%= c.isActive() ? "Active" : "Inactive"%></td>


        <td>
            <a href="/manage/category/modify?id=<%= c.getId()%>">Modify</a> | 
            <% if (c.isActive()) {%>
            <a href="/manage/category/activate?id=<%= c.getId()%>&action=deactivate">Deactivate</a>
            <% } else {%>
            <a href="/manage/category/activate?id=<%= c.getId()%>&action=activate">Activate</a>
            <% }%>



        </td>
    </tr>
    <% }%>
    <% } else {%>
    <tr>
        <td colspan="4" align="center">
            No categories yet.
        </td>
    </tr>
    <% }%>
</table>

<%-- Footer Area --%>
<%@ include file="/template/footer.jsp" %>
<%-- End of Footer Area --%>